<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
	<title>学生花名册</title>
	<link rel="stylesheet" type="text/css" href="../jQuery/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../jQuery/themes/icon.css">
	<script type="text/javascript" src="../jQuery/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="../jQuery/jquery.easyui.min.js"></script>
	<script>
		$(function(){
			$('#test').datagrid({
				title:'花名册',
				iconCls:'icon-save',
				nowrap: false,
				striped: true,
				collapsible:true,
				url:'searchstus?depid=383',
				columns:'stulist',
				sortName: 'code',
				sortOrder: 'desc',
				remoteSort: false,
				idField:'s_id',
				frozenColumns:[[
	                {field:'ck',checkbox:true},
	                {title:' 学生学号  ',field:'s_id',width:100,sortable:true}
				]],
				columns:[[
			        {title:'学生基本信息 ',colspan:8},
					{field:'opt',title:'联系方式',width:80,align:'center', rowspan:2,
						formatter:function(value,rec){
							return '<span style="color:red"><a href="#">查看</a></span>';
						}
					}
				],[
					{field:'name',title:'姓名',width:60},
					{field:'name',title:'性别',width:60},
					{field:'name',title:'年龄',width:60},
					{field:'name',title:'出生日期',width:60},
					{field:'name',title:'身份证号码',width:60},
					{field:'name',title:'户籍',width:60},
					{field:'name',title:'入学时间',width:60},
					{field:'name',title:'所在班级',width:60}
				]],
				pagination:true,
				rownumbers:true,
				toolbar:[{
					id:'btnadd',
					text:'添加 ',
					iconCls:'icon-add',
					handler:function(){
						alert('add')
					}
				},{
					id:'btndel',
					text:'删除',
					iconCls:'icon-cut',
					handler:function(){
						alert('cut')
					}
				},'-',{
					id:'btnreload',
					text:'刷新',
					iconCls:'icon-reload',
					handler:function(){
						alert('reload')
					}
				}]
			});
			var p = $('#test').datagrid('getPager');
			if (p){
				$(p).pagination({
					onBeforeRefresh:function(){
						alert('before refresh');
					}
				});
			}
		});
		function resize(){
			$('#test').datagrid('resize', {
				width:700,
				height:400
			});
		}
		function getSelected(){
			var selected = $('#test').datagrid('getSelected');
			if (selected){
				alert(selected.code+":"+selected.name+":"+selected.addr+":"+selected.col4);
			}
		}
		function getSelections(){
			var ids = [];
			var rows = $('#test').datagrid('getSelections');
			for(var i=0;i<rows.length;i++){
				ids.push(rows[i].code);
			}
			alert(ids.join(':'));
		}
		function clearSelections(){
			$('#test').datagrid('clearSelections');
		}
		function selectRow(){
			$('#test').datagrid('selectRow',2);
		}
		function selectRecord(){
			$('#test').datagrid('selectRecord','002');
		}
		function unselectRow(){
			$('#test').datagrid('unselectRow',2);
		}
		function mergeCells(){
			$('#test').datagrid('mergeCells',{
				index:2,
				field:'addr',
				rowspan:2,
				colspan:2
			});
		}
	</script>
</head>
<body class="easyui-layout">
	<div region="south" border="true" style="height:30px;background:#E8F0FD;" align="center">
		<font size="+1">Copyright &copy; 重庆理工大学 2011</font>
	</div>
	<div region="west" split="true" title="计算机科学与工程学院" style="width:280px;padding1:1px;overflow:hidden;">
		<div id="treePanel">
    		<ul class="tree" id="treeDemo" style="width:300px;overflow:auto"></ul> 
  		</div>
	</div>
	<div region="center" style="width:100%;overflow:hidden;">
		<table id="test"></table>
	</div>
	
	
	<div region="east" iconCls="icon-reload" title="Tree Menu" split="true" style="width:180px;">
			312
			<s:iterator value="stulist">
				ss:<s:property value="s_id"/>
				ss:<s:property value="s_name"/>
			</s:iterator>
			<s:debug></s:debug>
	</div>

</body>